<%--
 *  File:    DTKeyPerson.jsp
 *  @Author: Jackyin 
 *  Date:    2011/01/27
 *
 *  Copyright (C) 2000 - 2011 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java"%>
<%@ page import="java.util.*"%>
<%@ page import="org.apache.log4j.Category"%>

<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom"%>
<%
  //init param
  Category cat = Category.getInstance("jsp.DTKeyPerson"); 
String privilegeCode = "10101";
String strModuleName = "OGM";
  String contextPath = request.getContextPath();
%>
<%@ include file="/inc/PageDefault.inc"%>

<html>
<head>
<title>DTKeyPerson</title>
<PageFlow:CheckPageFlow pageName="p_zyldtkeyperson" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet"
	href="<%= contextPath%>/css/<%= strLanguageCode %>/main.css"
	type="text/css">
<script language="JavaScript"
	src="<%= contextPath%>/css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="<%= contextPath%>/js/ScriptLib.js"></script>
<%@ include file="/inc/SummaryDivision.inc"%>
<%
  Vector totalsummary = (Vector)pageContext.getAttribute("totalsummary");
  if(totalsummary == null)
  {
	  totalsummary = new Vector();
  }          
%>
<script>
function page_delete()
{
	if(isNullChecked(cform.deleteids))
	{
	  alert("<%=message.getMessageDesc("PLEASE_SELECT")%>");
	  return;
	}
  	document.cform.actionname.value = "delete";
  	cform.target = "_self";
  	//isRunning = true;
  	//document.cform.submit();
  	 __submitData('dtkey',true);
     }

function page_add()
{
	
	if(!checkForm(document.cform))
			return;
	var phone = document.cform.phone.value;
	if(phone!=""){
	if(phone.length<7){
        alert("请输入正确的电话号码！");
        return ;
    	}
	}
     document.cform.actionname.value = "add" ;
     cform.target = "_self";
     //isRunning = true;
     //document.cform.submit();
     __submitData('dtkey',true);
  }

function page_summary(actionvalue,orderbyname)
 {
	 
  var editform = summaryPrepare(cform,actionvalue,orderbyname);
 
  editform.action = "DTKeyPerson.jsp?<%= OvalTools.randomURL() %>";
  
  editform.target = "_self";
  isRunning = true;
  editform.submit();
 }

function page_back(){
	window.location.href="OrgSummary.jsp?<%= OvalTools.randomURL() %>&summaryidentify=distributor&languagecode=<%=strLanguageCode%>";
}

</script>

</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
   <table width="100%" cellspacing="0" cellpadding="0">
	   <form name="cform" id="dtkey" method="post" action="<%= contextPath%>/Dispatcher" target="_self">
		<input type="hidden" name="pagename" value="p_zyldtkeyperson">
		<custom:hidden property="actionname"></custom:hidden>
		<custom:hidden property="orgid"></custom:hidden>
	     <tr>
		<td valign="top">
		<table width="100%" cellspacing="0" cellpadding="0">
			<tr>
				<td class="summary_top"></td>
			</tr>
		</table>
		<table width="100%" border="1" cellpadding="0"
			bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0"
			align="center">
			<tr>
			<!-- 
				<tr>
					<td width="5%" class="deepblue-left">&nbsp;</td>
					<td class="deepblue-left">&nbsp;<a
						href="javascript:page_summary('orderby','jobtitle')"><%= label.getLabelName("L_JobTitleName") %></a> <font size="3" color="red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</font> </td>
					<td class="deepblue-left">&nbsp;<a
						href="javascript:page_summary('orderby','name')"><%= label.getLabelName("L_OnceCustomerName") %></a><font size="3" color="red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</font>  </td>
					<td class="deepblue-left">&nbsp;<a
						href="javascript:page_summary('orderby','phone')"><%= label.getLabelName("L_Phone") %></a></td>
					<td class="deepblue-left">&nbsp;<a
						href="javascript:page_summary('orderby','interests')"><%= label.getLabelName("L_Interests") %></a></td>
				</tr>
					 -->	
				<tr>
					<td width="5%" class="deepblue-left">&nbsp;</td>
					<td class="deepblue-left">&nbsp;<%= label.getLabelName("L_JobTitleName") %> <font size="3" color="red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</font> </td>
					<td class="deepblue-left">&nbsp;<%= label.getLabelName("L_OnceCustomerName") %><font size="3" color="red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</font>  </td>
					<td class="deepblue-left">&nbsp;<%= label.getLabelName("L_Phone") %></td>
					<td class="deepblue-left">&nbsp;<%= label.getLabelName("L_Interests") %></td>
				</tr>
				
				<%
        int i = 0;
     String strClassType = new String("");
            %>
				<logic:iterate id="onerow" collection="<%=totalsummary %>">
					<% 
       if(i%2 == 1)
       {
    	   strClassType = "td-listrom";
       }else{                    
    	   strClassType = "none";
       }
       i++;        
     %>
					<tr onMouseOver="this.className='tr-over'"
						onMouseOut="this.className='<%=JspHelper.filterNull( strClassType )%>'"
						class="<%=JspHelper.filterNull( strClassType )%>">
						<td><custom:checkbox property="zyldtkeypersonid"
							name="onerow" styleClass="checkbox" changedName="deleteids" ></custom:checkbox>
						</td>
						<td><custom:write property="jobtitle" name="onerow"
							dictType="KeyPersonJobTitle" nbsp="true"/></td>
						<td><custom:write property="name" name="onerow" nbsp="true" /></td>
						<td><custom:write property="phone" name="onerow" nbsp="true" /></td>
						<td><custom:write property="interests" name="onerow" 
							nbsp="true" /> </td>
					</tr>
				</logic:iterate>

				<% //--------------------------------------  flipping page --%>
				<tr>
					<td>&nbsp;</td>
					<td><custom:selectdic dictType="KeyPersonJobTitle"
						property="jobtitle" defaultValue="----------" defaultValueCost="" name="newdata" command="notnull" label="L_JobTitleName"/></td>
					<td><custom:text property="name" command="notnull" name="newdata" label="L_OnceCustomerName"></custom:text></td>
					<td><custom:text  property="phone" command="notnegative" name="newdata" dataFormat="integer" label="L_Phone" ></custom:text></td>
					<td><custom:text property="interests" name="newdata"></custom:text>
					
					</td>
				</tr>
		</table>
		<table width="100%" cellspacing="0" cellpadding="0">
			<tr>
				<td class="summary_top"></td>
			</tr>
			<tr>
				<td class="td_center">
				<a onclick="page_add();"><custom:button type="2" label="L_Add" imgsrc="finish.gif" border="0" style="width:60" /></a>
				<a onclick="page_delete();"><custom:button type="2" label="L_Delete" imgsrc="finish.gif" border="0" style="width:60"/>
				</a>
				<a onclick="__back()"><custom:button type="2" label="L_Back" imgsrc="delete.gif" border="0" style="width:60"/></a>
				</td>
			</tr>
		</table>
		</td>
	</tr>
	</form>
</table>
</body>
</html>


